<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:atria="http://www.atria.cz/common/jsf"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        >

<ui:component>
    <style type="text/css">
         .first{
             width:50px;
         }
        .second{
            width:250px;
        }
        .third{
            width:50px;
            text-align:center;
        }
    </style>

    <h:panelGroup id="allContactAtriaPanel">
        <atria:advancedTable id="allContactTable"
                             value="#{contactBean.allContacts}"
                             var="contactData"
                             rows="5"
                             focusedItem="#{contactBean.focusedItem}"
                             selectMode="SINGLE"
                             styleClass="grid"
                             cycledCursor="false"
                             focusedRowClass="selected"
                             autoFocus="false"
                             columnClasses="first, second, third">
            <!--<rich:dataTable id="allContactTable"-->
            <!--value="#{contactBean.allContacts}"-->
            <!--var="contact"-->
            <!--rows="5"-->
            <!--width="100%">-->
            <rich:column>
                <f:facet name="header">
                    <h:outputLabel value="Image"/>
                </f:facet>
                <a4j:outputPanel rendered="#{contactData.addsByMe}">
                    <core:pictureForView style="width:50px; resize:both;"
                                         pictureKey="contact_#{contactData.id}"
                            />
                </a4j:outputPanel>
                <a4j:outputPanel rendered="#{not contactData.addsByMe}">
                    <core:pictureForView style="width:50px; resize:both;"
                                         pictureKey="photoprofile_#{contactData.informationId}"
                            />
                    <!--informationId="#{contactData.informationId}"-->
                </a4j:outputPanel>
            </rich:column>

            <rich:column filterExpression="#{fn:containsIgnoreCase(contactData.fullName,contactSessionBean.filterContact)}">
                <f:facet name="header">
                    <h:outputLabel value="Full Name"/>
                </f:facet>
                <h:outputText value="#{contactData.fullName}"/>
            </rich:column>

            <rich:column>
                <f:facet name="header">
                    <h:outputLabel value="Adds By Me"/>
                </f:facet>
                <h:selectBooleanCheckbox style="text-align:center;" disabled="true" value="#{contactData.addsByMe}"/>
            </rich:column>

            <a4j:support event="onchangefocus"
                         reRender="otherContactPanel, allContactToolBar"
                         action="#{contactBean.assignCurrentData}">
                <!--<f:setPropertyActionListener value="#{contact}" target="#{contactBean.focusedItem}"/>-->
            </a4j:support>

        </atria:advancedTable>
        <!--</rich:dataTable>-->
        <rich:datascroller align="center"
                           for="allContactTable"
                           style="width:100%"
                           maxPages="100"
                           limitToList="true"
                           ajaxSingle="false"
                           renderIfSinglePage="false"
                           page="#{contactBean.scrollerPage}"
                           reRender="allContactAtriaPanel"/>

    </h:panelGroup>

</ui:component>


</html>